﻿//-----------------------------------------------------------------------
// <copyright file="IProduct.cs" company="Craig Longford (deltawolf7@gmail.com)">
//     Copyright (c) Craig Longford. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Delta.Mercury.Business.Commerce
{
    using System;
    using Delta.Data.DataExpress;

    /// <summary>
    /// Product interface
    /// </summary>
    public interface IProduct : IDataServicable
    {
        #region Properties
        /// <summary>
        /// Gets Unique identifier
        /// </summary>
        Guid Guid { get; }

        /// <summary>
        /// Gets or sets a value indicating whether the the product is active or not.
        /// </summary>
        bool Active { get; set; }

        /// <summary>
        /// Gets or sets the cost of the product
        /// </summary>
        decimal Cost { get; set; }    

        /// <summary>
        /// Gets or sets the product description
        /// </summary>
        string Description { get; set; }     

        /// <summary>
        /// Gets or sets the manufacturer unique identifier
        /// </summary>
        Guid ManufacturerGuid { get; set; }

        /// <summary>
        /// Gets or sets the manufacturers part number
        /// </summary>
        string ManufacturerPartNumber { get; set; }

        /// <summary>
        /// Gets or sets the name of the product
        /// </summary>
        string Name { get; set; }

        /// <summary>
        /// Gets or sets the price of the product
        /// </summary>
        decimal Price { get; set; }

        /// <summary>
        /// Gets or sets the product SKU
        /// </summary>
        string SKU { get; set; }

        /// <summary>
        /// Gets or sets the supplier guid
        /// </summary>
        Guid SupplierGuid { get; set; }

        /// <summary>
        /// Gets or sets the supplier part number
        /// </summary>
        string SupplierPartNumber { get; set; }

        /// <summary>
        /// Gets or sets the product stock
        /// </summary>
        int Stock { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the product is taxable
        /// </summary>
        bool Taxable { get; set; }
        #endregion

        #region Methods
        /// <summary>
        /// Save the product to the database
        /// </summary>
        void Save();

        /// <summary>
        /// Deletes the product from database
        /// </summary>
        void Delete();

        /// <summary>
        /// Gets product attributes
        /// </summary>
        /// <returns>Collection of attributes</returns>
        Attributes GetAttributes();

        /// <summary>
        /// Get product catgeories
        /// </summary>
        /// <param name="showDelete">Show deleted</param>
        /// <returns>Collection of categories</returns>
        Categories GetCategories(bool showDelete);

        /// <summary>
        /// Gets product images
        /// </summary>
        /// <param name="showDeleted">Show deleted</param>
        /// <returns>Collection of images</returns>
        Images GetImages(bool showDeleted);

        /// <summary>
        /// Check if product has link to category
        /// </summary>
        /// <param name="category">Category to check</param>
        /// <param name="showDeleted">Show deleted</param>
        /// <returns>Retruns true is link is found, else false</returns>
        bool HasCategoryLink(Category category, bool showDeleted);
        #endregion
    }
}
